/************************************************************************************** 
    WFTask

    Copyright (C) 2010 =OsDevD=

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 **************************************************************************************
 */
package ez.workflow.task;

import java.security.Principal;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import ez.workflow.activity.WFActivityI;
import ez.workflow.process.WFProcess;
import ez.workflow.process.WFProcessManager;
import ez.workflow.transition.WFTransitionLink;

/**
 * 
 * Each WFActivity has WFTasks/ or NULL Tasks
 * 
 * @author OSDevD
 *
 */
public class WFTask implements WFActivityI{
	
	public WFTask(int activityId, int processId, int taskId) {
		super();
		this.activityId = activityId;
		this.processId = processId;
		this.taskId = taskId;
	}

	private int activityId;
	private int processId;
	private int taskId;
	private Principal taskOwner;
	
	
	public WFTask(int activityId, int processId){
		this.activityId = activityId;
		this.processId = processId;
		this.taskId = nextTaskId();
		
	}
	
	public WFTask(Principal user, int activityId, int processId){
		this.taskOwner = user;
		
	}
	
	/**
	 * generate next Task Id
	 * @return
	 */
	private int nextTaskId(){
		return 0;
	}

	@Override
	public String getDecisionStatus() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void addPredeccessorWFActivity(
			WFTransitionLink incomingWFTransitionlink, WFActivityI wfActivity) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void addSuccessorWFActivity(
			WFTransitionLink outcomingWFTransitionLink, WFActivityI step) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public WFTransitionLink execute() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Principal getActor() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Collection getAvailableIncomingWFTransitionLinks() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Collection getAvailableOutcomingWFTransitionLinks() {
		// TODO Auto-generated method stub
		return null;
	}

	
	public WFTransitionLink getExecutionTransitionResult() {
		// TODO Auto-generated method stub
		WFTransitionLink transition = null;
		WFProcessManager processManager = this.getWorkflowProcess().getProcessManager();
		//processManager.getTaskHandleQueue()
		return transition;
	}

	@Override
	public Date getEndTime() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List getErrors() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object[] getMessageArguments() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getMessageKey() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public WFActivityI getPredeccessorWFActivity(
			WFTransitionLink incomingWFTrannsitionLink) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Date getStartTime() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public WFActivityI getSuccessorWFActivity(
			WFTransitionLink outcomingWFTransitionLink) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public WFProcess getWorkflowProcess() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isCompleted() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean isStarted() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void start() {
		// TODO Auto-generated method stub
		
	}

	
}
